home *** CD-ROM | disk | FTP | other *** search
/ Dr. Windows 3 / dr win3.zip / dr win3 / DATABASE / MSADDL11.ZIP / MSADDL11.TXT < prev    next >
Text File  |  1993-06-17  |  49KB  |  937 lines

  1. ****************************************************************************
  2. ----------------------------------------------------------------------------
  3. |                         IMPORTANT - PLEASE READ                          
  4. ----------------------------------------------------------------------------
  5. |
  6. | You have a royalty-free right to use, modify, reproduce and distribute 
  7. | the software found in these sample files provided, however, that: (a)   
  8. | you agree that the MS software is PROVIDED "AS IS" WITHOUT
  9. | WARRANTY OF ANY KIND and in no event shall MS be liable for 
  10. | any damages whatsoever in connection with your use of the software; 
  11. | and (b) the utilities are redististributed solely in conjunction with and 
  12. | as part of your software application.
  13. |                                                                          
  14. | Copyright 1993 Microsoft Corporation. All Rights Reserved.               
  15. | Microsoft and MS-DOS are registered trademarks and Microsoft Access and  
  16. | Windows are trademarks of Microsoft Corporation.                         
  17. ****************************************************************************
  18.  
  19. OVERVIEW
  20. --------
  21.    The Microsoft Access Data Definition Language Dynamic Link Library
  22.    (MSADDL11.DLL) provides data definition support beyond that provided by
  23.    standard Microsoft Access.
  24.  
  25. GOALS
  26. -----
  27.    To enable the Access Basic programmer to create and alter tables, fields, 
  28.    indexes, and relationships, and then use those tables in Microsoft Access
  29.    and Access Basic.
  30.  
  31. CAUTIONS
  32. --------
  33.    This Utility is provided specifically as an aid to developers who need
  34.    additional data definition information not provided in the Microsoft
  35.    Access retail documentation. As with any DLL, passing an incorrect
  36.    argument type or value could result in General Protection Fault (GPF)
  37.    errors. If this happens, carefully check your arguments. This Utility
  38.    includes an include file (MSA_DDL.TXT) that you can use to declare these
  39.    functions. This Utility is not supported by Microsoft; as such, you
  40.    should save your work-in-progress frequently to avoid loss of data. 
  41. ****************************************************************************
  42.  
  43. DESCRIPTION OF THE DATA DEFINITION DDL
  44. --------------------------------------
  45.    The Data Definition interface is a Dynamic Link Library (DLL) you can
  46.    call from Access Basic. Its purpose is to allow Access Basic programmers 
  47.    to programatically manipulate table definitions and data relationships.
  48.    For example, this DLL lets you create tables via Access Basic code.
  49.  
  50.    (Note: You can use these functions only with Microsoft Access databases
  51.           and tables, and not with any other databases or tables.)
  52.  
  53.    Table 1 lists the functions provided by MSADDL11.DLL. Each function is
  54.    fully described later in this document.
  55.  
  56.       Table 1.  MSADDL11.DLL Functions
  57.       ----------------------------------------------------------------------
  58.       Function Name             Purpose
  59.       ------------------------- --------------------------------------------
  60.       AccessDDLStartEngine      Initializes Microsoft Access database engine
  61.       AccessDDLStopEngine       Stops the database engine
  62.  
  63.       AccessDDLOpenDatabase     Opens a specified Microsoft Access database
  64.       AccessDDLCloseDatabase    Closes the database
  65.  
  66.       AccessDDLOpenTable        Opens an existing table
  67.       AccessDDLCloseTable       Closes an open table
  68.       AccessDDLCreateTable      Creates a new table
  69.       AccessDDLDeleteTable      Deletes an existing table
  70.       AccessDDLRenameTable      Renames an existing table
  71.  
  72.       AccessDDLAddField         Adds a new field to a table
  73.       AccessDDLDeleteField      Deletes an existing field
  74.       AccessDDLRenameField      Renames an existing field
  75.  
  76.       AccessDDLCreateIndex      Creates a new index in an existing table
  77.       AccessDDLDeleteIndex      Deletes an existing index
  78.       AccessDDLRenameIndex      Renames an existing index
  79.  
  80.       AccessDDLCreateReference  Creates a new relationship between tables
  81.       AccessDDLDeleteReference  Deletes an existing relationship
  82.  
  83. ****************************************************************************
  84.  
  85. GENERAL DDL PROCEDURE
  86. ---------------------
  87.    Before you can create, alter, or delete a table, field, index, or
  88.    relationship, you must first use the AccessDDLStartEngine function to
  89.    initialize the Microsoft Access ISAM database engine. When you are
  90.    finished with all DDL operations, use the AccessDDLStopEngine function.
  91.    The following figure illustrates this general procedure.
  92.  
  93.       Figure 1.  General DDL Procedure
  94.       ----------------------------------------------------------------------
  95.       
  96.       AccessDDLStartEngine
  97.       AccessDDLOpenDatabase
  98.  
  99.         AccessDDLOpenTable
  100.         ' Perform field, index, and relationship operations.
  101.         AccessDDLCloseTable
  102.  
  103.         AccessDDLCreateTable
  104.         ' Perform field, index, and relationship operations.
  105.         AccessDDLCloseTable
  106.  
  107.       AccessDDLCloseDatabase
  108.       AccessDDLStopEngine
  109.  
  110. ****************************************************************************
  111.  
  112. OTHER CONSIDERATIONS
  113. --------------------
  114.    The various functions in MSADDL11.DLL don't let you set all of the
  115.    properties normally available in MS Access table design (such as
  116.    Description and Validation Rule). To set or change these properties, you
  117.    must use the regular table design feature of Microsoft Access.
  118.  
  119. ****************************************************************************
  120.  
  121. FUNCTION DESCRIPTIONS
  122. ---------------------
  123. AccessDDLStartEngine Function
  124.  
  125.       Description  Performs the initialization required to use the Microsoft
  126.                    Access ISAM database engine.
  127.  
  128.       Syntax       AccessDDLStartEngine(SysDBName, INIFileName, UserName,
  129.                       Password)
  130.  
  131.       Remarks      The AccessDDLStartEngine function uses the following
  132.                    arguments.
  133.  
  134.                    Argument       Description
  135.                    -------------- ------------------------------------------
  136.                    SysDBName      String that identifies the path and name
  137.                                   of the system database file; must be a
  138.                                   valid operating system path; this argument 
  139.                                   is ignored when AccessDDLStartEngine is
  140.                                   called from Access Basic, since the path
  141.                                   and name have already been established.
  142.                    INIFileName    String that identifies the path and name
  143.                                   of the INI file; length may not exceed 14
  144.                                   characters; this argument is ignored when
  145.                                   AccessDDLStartEngine is called from Access
  146.                                   Basic, since the path and name have
  147.                                   already been established.
  148.                    UserName       String that is that name of the current
  149.                                   user.
  150.                    Password       String that is the current user's
  151.                                   password.
  152.       
  153.       Returns
  154.       ----------------------------------------------------------------------
  155.       ACCESSDDL_ErrSuccess             Operation was successful.
  156.       ACCESSDDL_ErrAccessDenied        Current user doesn't have required
  157.                                        permissions.
  158.       ACCESSDDL_ErrAlreadyInitialized  AccessDDLStartEngine already called.
  159.       ACCESSDDL_ErrInvalidAccountName  Couldn't find account name.
  160.       ACCESSDDL_ErrInvalidParameter    One or more parameters is invalid or
  161.                                        Null.
  162.       ACCESSDDL_ErrInvalidPassword     Incorrect or invalid password.
  163.       ACCESSDDL_ErrPermissionDenied    Invalid DatabaseID argument.
  164.       ACCESSDDL_ErrTooManyTasks        Too many concurrent DDL instances.
  165.  
  166. AccessDDLStopEngine Function
  167.  
  168.       Description  Stops the Micros